<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<% 
	String path = request.getContextPath();
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>addPayment</title>
<script type="text/javascript">

function validateForm() {
	var title = document.getElementById("title"); 
	var remark = document.getElementById("remark"); 
	
	if (title.value == "") {
		alert("Title is null.");
		return;
	} else if (remark.value == "") {
		alert("Remark is null.");
		return;
	}  

	document.frm.submit();
}

</script>
</head>
<body>
<form name="frm" action="<%=path %>/purchase/createPurchase.do" method="post">
	<table align="center">
		<tr align="center">
			<td colspan="2">addPurchase</td>
		</tr>
		<tr>
			<td>Title:</td>
			<td><input type="text" id="title" name="title" /></td>
		</tr>
		<tr>
			<td>Remark:</td>
			<td><input type="text" id="remark" name="remark" /></td>
		</tr>
		<tr>
			<td>Manager:</td>
			<td>
				<select name="manager">
					<option value="manager1">manager1</option>
					<option value="manager2">manager2</option>
				</select>
			</td>
		</tr>
		<tr align="center">
			<td colspan="2">
				<input type="button" value="save" onclick="validateForm();" /> 
			</td>
		</tr>
	</table>
</form>
</body>
</html>